#ifndef HISTORY_H
#define HISTORY_H

#include <QWidget>
#include <QCalendarWidget>
#include <QDate>
#include <QListView>
#include <QSqlQueryModel>
#include <QSqlDatabase>
#include <QSqlQuery>
#include "qcustomplot.h"

namespace Ui {
class history;
}

class history : public QWidget
{
    Q_OBJECT

public:
    explicit history(QWidget *parent = nullptr);
    ~history();

signals:
    void backToMainPage();

private slots:
    void on_pBtn_back_clicked();

    void on_pushButton_clicked();
    void dateSelected(const QDate &date);
    void on_listView_clicked(const QModelIndex &index);

private:
    Ui::history *ui;
    QCalendarWidget *calendar;
    QSqlQueryModel *model;
    void updateListView();
    void plotData(const QString &tableName);
};

#endif // HISTORY_H
